package io2;

import io2.Student;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;


public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name="lisa";
        int age=23;
        String gender="男";
        String[] otherInfo={"是一名学生","河南平顶山","喜欢打篮球","喜欢挣钱"};
        Student stu=new Student(name,age,gender,otherInfo);
        System.out.println(stu);
        FileOutputStream fos=new FileOutputStream("student.obj");
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        oos.writeObject(stu);
        System.out.println("写出完毕");
        oos.close();

    }
}















